//
//  PropertyFeeViewController.m
//  wtshoppingcite
//
//  Created by TW on 15-1-28.
//  Copyright (c) 2015年 TW. All rights reserved.
//

#import "PropertyFeeViewController.h"
#import "ParkingFeeViewController.h"
//#import "ManageFeeViewController.h"
#import "ManageFeeInfoViewController.h"

@interface PropertyFeeViewController ()<UITableViewDelegate,UITableViewDataSource>


@property(nonatomic,strong)UITableView *paymentTableView;
@property(nonatomic,strong)NSArray *imageArray;
@property(nonatomic,strong)NSArray *titleArray;
@property(nonatomic,strong)NSArray *subTitleArray;


@end

@implementation PropertyFeeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    [self setTitleView:@"缴物业费"];
    
    _imageArray = @[@"wuyefee",@"tingchefee"];
    _titleArray = @[@"缴物业费",@"缴停车费"];
    _subTitleArray = @[@"手机物业，随时随地掌控一切",@"缴纳停车费，分秒解决"];
    
    self.view.backgroundColor = UIColorFromRGB(0xfbfbfb);
    
    _paymentTableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, kWidth, 160) style:UITableViewStylePlain];
    _paymentTableView.delegate = self;
    _paymentTableView.dataSource = self;
    _paymentTableView.scrollEnabled = NO;
    [self.view addSubview:_paymentTableView];
    
    
    // Do any additional setup after loading the view.
}


#pragma mark uitableView -DataSource
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 2;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"propertyCell"];
    if (cell == nil) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"propertyCell"];
        
        UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(5, 5, 60, 60)];
        imageView.tag = 100;
        [cell.contentView addSubview:imageView];
        
        UILabel *title = [self createLabelWithFrame:CGRectMake(imageView.right+5, 10, 220, 20) text:@"" font:16.0f textAli:NSTextAlignmentLeft textColor:MAIN_BLACK_COLOR];
        title.tag = 101;
        [cell.contentView addSubview:title];
        
        UILabel *subTitle = [self createLabelWithFrame:CGRectMake(imageView.right+5, title.bottom+10, 220, 20) text:@"" font:14.0f textAli:NSTextAlignmentLeft textColor:MAIN_GRAY_COLOR];
        subTitle.tag = 102;
        [cell.contentView addSubview:subTitle];
        
    }
    UIImageView *imageView = (UIImageView *)[cell.contentView viewWithTag:100];
    imageView.image =[UIImage imageNamed:_imageArray[indexPath.row]];
    
    UILabel *title = (UILabel *)[cell.contentView viewWithTag:101];
    title.text = _titleArray[indexPath.row];
    
    UILabel *subTitle = (UILabel *)[cell.contentView viewWithTag:102];
    subTitle.text = _subTitleArray[indexPath.row];
    
    return cell;
}

#pragma mark tableView -Delegate
-(CGFloat )tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 80;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
//    if (indexPath.row == 0) {
    
//        ManageFeeViewController *manageFeeVC = [[ManageFeeViewController alloc]init];
//        manageFeeVC.hidesBottomBarWhenPushed = YES;
//        [self.navigationController pushViewController:manageFeeVC animated:YES];
        
        ManageFeeInfoViewController* manageFeeInfoVC = [[ManageFeeInfoViewController alloc] init];
        manageFeeInfoVC.hidesBottomBarWhenPushed = YES;
        [self.navigationController pushViewController:manageFeeInfoVC animated:YES];
        
//    }else if (indexPath.row == 1){
        
//        ParkingFeeViewController *parkingVC = [[ParkingFeeViewController alloc]init];
//        parkingVC.hidesBottomBarWhenPushed = YES;
//        [self.navigationController pushViewController:parkingVC animated:YES];
//        
//    }
    
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    ;
}


- (void)viewWillDisappear:(BOOL)animated
{
    
    [super viewWillDisappear:animated];
    
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
